import request from '@/utils/request'
const req = request.service;

export default{
    queryDeptTree(data){

        const postData = data || {}
        return req({
            url: "/user/dept/tree",
            method: 'post',
            data:postData
        })
    },
    queryUser(data){

        const postData = data || {}
        return req({
            url: "/user",
            method: 'post',
            data:postData
        })
    },
    saveUser(data){
        return req({
            url: data.yhbh?'/user/save':'/user/add',
            method: 'post',
            data:data
        })
    },
    delUser(data){
        return req({
            url: "/user/delete",
            method: 'post',
            data:data
        })
    },
    queryRole(data){
        return req({
            url: "/user/role",
            method: 'post',
            data:data
        })
    },
    saveRole(type,data){
        return req({
            url: type==0?"/user/role/add":"/user/role/delete",
            method: 'post',
            data:data
        })
    },
    resetPassword(data){
        return req({
            url: "/user/password",
            method: 'post',
            data:data
        })
    }
}